var Q = require('q');
var $$ = require('jXHR');

function transmit(){
var xhr = Ti.Network.createHTTPClient();
xhr.onload = function(e) {
 //handle response, which at minimum will be an HTTP status code
  if(this.status == '200'){
        alert('Transmission successful!');
        //if(this.readyState == 4){
        //  alert('Response = ' + response);
        //}else{
        //  alert('HTTP Ready State != 4');
        //}           
     }else{
        alert('Transmission failed. Try again later. ' + this.status + " " + this.response);
     }
};
xhr.open('POST','http://fleon.esy.es/sms_contact/test.php');
xhr.send({
	title:'My awesome blog..',
	body:'Today I met Susy at the laundromat.  Best day EVAR\!'
});
}

$.index.open();

/*var ajax = Ti.Network.createHTTPClient();
ajax.onerror = function(e){
    alert('Error');
};
ajax.onload = function(){
    Titanium.API.info(this.responseText);
    var data = this.responseText;
    var jdata = JSON.parse(data);
    //alert(jdata.varname);
     
};
ajax.open('POST', 'http://fleon.esy.es/sms_contact/test.php');
ajax.send({
    'num_phone': '123',
});*/
